package com.jiazhong.shixi_bookstore.controller;

import com.jiazhong.shixi_bookstore.bean.Category;
import com.jiazhong.shixi_bookstore.mapper.CategoryMapper;
import com.jiazhong.shixi_bookstore.utll.JsonResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
@CrossOrigin("*")
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Resource
    private CategoryMapper categoryMapper;
    @RequestMapping("/find")
    public JsonResult find(){
        List<Category> list = categoryMapper.find();
        JsonResult result = new JsonResult(true,200,list,"");
        return result;
    }
}
